# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=sink
pkgver=0.8.0
pkgrel=0
pkgdesc="Offline caching, synchronization and indexing system for PIM data"
# armhf blocked by qt5-qtdeclarative
# s390x blocked by flatbuffers
arch="all !armhf !s390x !mips !mips64"
url="https://community.kde.org/KDE_PIM"
license="LicenseRef-KDE-Accepted-GPL"
depends_dev="qt5-qtbase-dev kmime-dev kcontacts-dev kcalendarcore-dev xapian-core-dev lmdb-dev kasync-dev kimap2-dev kdav2-dev curl-dev flatbuffers-dev libexecinfo-dev"
makedepends="$depends_dev extra-cmake-modules"
source="https://download.kde.org/unstable/sink/$pkgver/src/sink-$pkgver.tar.xz
	fix-build-failures.patch
	"
subpackages="$pkgname-dev"
options="!check" # Tests compilation is broken

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}
sha512sums="008ca8355ffbed2bf89a906510aac4c505c8e44de49f445db283aa565e233e7652f2e46c5bcf37e680dec940a8c0f1525e6a8f708e1b4742db62522255c8bad6  sink-0.8.0.tar.xz
b4a68367f1866e67aa8787b1d54ba27464a92b4a0c096944ad691fbd883fe70e5829cc886e04ec287e8be71808bd70bd3c7ffafb9de8e46e4c3193af2cd918dd  fix-build-failures.patch"
